home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / OCEMail.p < prev    next >
Text File  |  1995-09-14  |  45KB  |  1,642 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 8:29:56 PM }
  2. {}
  3. {     File:        OCEMail.p}
  4. { }
  5. {     Contains:    Apple Open Collaboration Environment OCEMail Interfaces.}
  6. { }
  7. {     Version:    Technology:    AOCE Toolbox 1.02}
  8. {                 Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
  9. { }
  10. {     Copyright:    © 1984-1995 by Apple Computer, Inc.}
  11. {                 All rights reserved.}
  12. { }
  13. {     Bugs?:        If you find a problem with this file, use the Apple Bug Reporter}
  14. {                 stack.  Include the file and version information (from above)}
  15. {                 in the problem description and send to:}
  16. {                     Internet:    apple.bugs@applelink.apple.com}
  17. {                     AppleLink:    APPLE.BUGS}
  18. { }
  19. {}
  20.  
  21. unit OCEMail;
  22. interface
  23.  
  24.  
  25. {$IFC UNDEFINED __OCEMAIL__}
  26. {$SETC __OCEMAIL__ := 1}
  27.  
  28.     uses
  29.         ConditionalMacros, Types, AppleTalk, Processes, PPCToolbox, Notification, EPPC, Files, Aliases, AppleEvents, Memory, TextEdit, DigitalSignature, OCE, OCEAuthDir, OCEMessaging;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.     type
  35.         MSAMIOCompletionProcPtr = ProcPtr;  { PROCEDURE MSAMIOCompletion(VAR paramBlock: MSAMParam); }
  36.         MSAMIOCompletionUPP = UniversalProcPtr;
  37.  
  38.         MailMsgRef = LONGINT;
  39.  
  40. { reference to an open msam queue }
  41.         MSAMQueueRef = LONGINT;
  42.  
  43. { identifies slots managed by a PMSAM }
  44.         MSAMSlotID = INTEGER;
  45.  
  46. { reference to an active mailbox }
  47.         MailboxRef = LONGINT;
  48.  
  49. { identifies slots within a mailbox }
  50.         MailSlotID = INTEGER;
  51.  
  52. { identifies a letter in a mailbox }
  53.         MailSeqNum = record
  54.                 slotID: MailSlotID;
  55.                 seqNum: LONGINT;
  56.             end;
  57.  
  58. { A MailBuffer is used to describe a buffer used for an IO operation.}
  59. {The location of the buffer is pointed to by 'buffer'. }
  60. {When reading, the size of the buffer is 'bufferSize' }
  61. {and the size of data actually read is 'dataSize'.}
  62. {When writing, the size of data to be written is 'bufferSize' }
  63. {and the size of data actually written is 'dataSize'.}
  64. {}
  65.         MailBuffer = record
  66.                 bufferSize: LONGINT;
  67.                 buffer: Ptr;
  68.                 dataSize: LONGINT;
  69.             end;
  70.  
  71. { A MailReply is used to describe a commonly used reply buffer format.}
  72. {It contains a count of tuples followed by an array of tuples.}
  73. {The format of the tuple itself depends on each particular call.}
  74. {}
  75.         MailReply = record
  76.                 tupleCount: INTEGER;
  77.         { tuple[tupleCount] }
  78.             end;
  79.  
  80. { Shared Memory Communication Area used when Mail Manager sends }
  81. {High Level Events to a PMSAM. }
  82. {}
  83.         SMCA = record
  84.                 smcaLength: INTEGER;                                { includes size of smcaLength field }
  85.                 result: OSErr;
  86.                 userBytes: LONGINT;
  87.                 case INTEGER of
  88.                     0: (
  89.                             slotCID: CreationID;                            { for create/modify/delete slot calls }
  90.                     );
  91.                     1: (
  92.                             msgHint: LONGINT;                            { for kMailEPPCMsgOpened }
  93.                     );
  94.             end;
  95.  
  96. {************************************************************************************}
  97. { Value of creator and types fields for messages and blocks defined by MailManager }
  98.  
  99.     const
  100.         kMailAppleMailCreator = 'apml';                        { message and letter block creator }
  101.         kMailLtrMsgType = 'lttr';                        { message type of letters, reports }
  102.         kMailLtrHdrType = 'lthd';                        { contains letter header }
  103.         kMailContentType = 'body';                        { contains content of letter }
  104.         kMailEnclosureListType = 'elst';                        { contains list of enclosures }
  105.         kMailEnclosureDesktopType = 'edsk';                        { contains desktop mgr info for enclosures }
  106.         kMailEnclosureFileType = 'asgl';                        { contains a file enclosure }
  107. { format is defined by AppleSingle }
  108.         kMailImageBodyType = 'imag';                        { contains image of letter }
  109. {        format is struct TPfPgDir - in Printing.h}
  110. {    *    struct TPfPgDir (}
  111. {    *        short    pageCount;        - number of pages in the image.}
  112. {    *        long    iPgPos[129];    - iPgPos[n] is the offset from the start of the block}
  113. {    *                                - to image of page n.}
  114. {    *                                - iPgPos[n+1] - iPgPos[n] is the length of page n.}
  115. {}
  116.         kMailMSAMType = 'gwyi';                        { contains msam specific information }
  117.         kMailTunnelLtrType = 'tunl';                        { used to read a tunnelled message }
  118.         kMailHopInfoType = 'hopi';                        { used to read hopInfo for a tunnelled message }
  119.         kMailReportType = 'rpti';                        { contains report info }
  120. {}
  121. {Reports have the isReport bit set in MailIndications and contain a block of type kMailReport.}
  122. {This block has a header, IPMReportBlockHeader,}
  123. {followed by an array of elements, each of type IPMRecipientReport}
  124. {}
  125. {Various families used by mail or related msgs}
  126. {}
  127.         kMailFamily = 'mail';                        { Defines family of "mail" msgs: content, header, etc }
  128.         kMailFamilyFile = 'file';
  129.  
  130. {************************************************************************************}
  131.  
  132.     type
  133.         MailAttributeID = INTEGER;
  134.  
  135. { Values of MailAttributeID }
  136. { Message store attributes - stored in the catalog }
  137. { Will always be present in a letter and have fixed sizes }
  138.  
  139.     const
  140.         kMailLetterFlagsBit = 1;                            { MailLetterFlags }
  141. { Letter attributes - stored in the letter }
  142. {   Will always be present in a letter and have fixed sizes }
  143.         kMailIndicationsBit = 3;                            { MailIndications }
  144.         kMailMsgTypeBit = 4;                            { OCECreatorType }
  145.         kMailLetterIDBit = 5;                            { MailLetterID }
  146.         kMailSendTimeStampBit = 6;                            { MailTime }
  147.         kMailNestingLevelBit = 7;                            { MailNestingLevel }
  148.         kMailMsgFamilyBit = 8;                            { OSType }
  149. { Letter attributes - stored in the letter}
  150. {   May be present in a letter and have fixed sizes }
  151.         kMailReplyIDBit = 9;                            { MailLetterID }
  152.         kMailConversationIDBit = 10;                            { MailLetterID }
  153. { Letter attributes - stored in the letter}
  154. {   May be present in a letter and have variable length sizes }
  155.         kMailSubjectBit = 11;                            { RString }
  156.         kMailFromBit = 12;                            { MailRecipient }
  157.         kMailToBit = 13;                            { MailRecipient }
  158.         kMailCcBit = 14;                            { MailRecipient }
  159.         kMailBccBit = 15;                            { MailRecipient }
  160.  
  161.  
  162.     type
  163.         MailAttributeMask = LONGINT;
  164.  
  165. { Values of MailAttributeMask }
  166.  
  167.     const
  168.         kMailLetterFlagsMask = $1;
  169.         kMailIndicationsMask = $4;
  170.         kMailMsgTypeMask = $8;
  171.         kMailLetterIDMask = $10;
  172.         kMailSendTimeStampMask = $20;
  173.         kMailNestingLevelMask = $40;
  174.         kMailMsgFamilyMask = $80;
  175.         kMailReplyIDMask = $100;
  176.         kMailConversationIDMask = $200;
  177.         kMailSubjectMask = $400;
  178.         kMailFromMask = $800;
  179.         kMailToMask = $1000;
  180.         kMailCcMask = $2000;
  181.         kMailBccMask = $4000;
  182.  
  183.  
  184.     type
  185.         MailAttributeBitmap = LONGINT;
  186.  
  187. {************************************************************************************}
  188.         MailLetterSystemFlags = INTEGER;
  189.  
  190. { Values of MailLetterSystemFlags }
  191. { letter is available locally (either by nature or via cache) }
  192.  
  193.     const
  194.         kMailIsLocalBit = 2;
  195.  
  196.         kMailIsLocalMask = $4;
  197.  
  198.  
  199.     type
  200.         MailLetterUserFlags = INTEGER;
  201.  
  202.  
  203.     const
  204.         kMailReadBit = 0;                            { this letter has been opened }
  205.         kMailDontArchiveBit = 1;                            { this letter is not }
  206. { to be archived either because }
  207. {                                           it has already been archived or }
  208. {                                           it should not be archived. }
  209.         kMailInTrashBit = 2;                            { this letter is in trash }
  210.  
  211. { Values of MailLetterUserFlags }
  212.         kMailReadMask = $1;
  213.         kMailDontArchiveMask = $2;
  214.         kMailInTrashMask = $4;
  215.  
  216.  
  217.     type
  218.         MailLetterFlags = record
  219.                 sysFlags: MailLetterSystemFlags;
  220.                 userFlags: MailLetterUserFlags;
  221.             end;
  222.  
  223.         MailMaskedLetterFlags = record
  224.                 flagMask: MailLetterFlags;                        { flags that are to be set }
  225.                 flagValues: MailLetterFlags;                        { and their values }
  226.             end;
  227.  
  228.  
  229.     const
  230.         kMailOriginalInReportBit = 1;
  231.         kMailNonReceiptReportsBit = 3;
  232.         kMailReceiptReportsBit = 4;
  233.         kMailForwardedBit = 5;
  234.         kMailPriorityBit = 6;
  235.         kMailIsReportWithOriginalBit = 8;
  236.         kMailIsReportBit = 9;
  237.         kMailHasContentBit = 10;
  238.         kMailHasSignatureBit = 11;
  239.         kMailAuthenticatedBit = 12;
  240.         kMailSentBit = 13;
  241.         kMailNativeContentBit = 14;
  242.         kMailImageContentBit = 15;
  243.         kMailStandardContentBit = 16;
  244.  
  245. { Values of MailIndications }
  246.         kMailStandardContentMask = $8000;
  247.         kMailImageContentMask = $4000;
  248.         kMailNativeContentMask = $2000;
  249.         kMailSentMask = $1000;
  250.         kMailAuthenticatedMask = $800;
  251.         kMailHasSignatureMask = $400;
  252.         kMailHasContentMask = $200;
  253.         kMailIsReportMask = $100;
  254.         kMailIsReportWithOriginalMask = $80;
  255.         kMailPriorityMask = $60;
  256.         kMailForwardedMask = $10;
  257.         kMailReceiptReportsMask = $8;
  258.         kMailNonReceiptReportsMask = $4;
  259.         kMailOriginalInReportMask = $3;
  260.  
  261.  
  262.     type
  263.         MailIndications = LONGINT;
  264.  
  265. { values of the field originalInReport in MailIndications }
  266.  
  267.     const
  268.         kMailNoOriginal = 0;                            { do not enclose original in reports }
  269.         kMailEncloseOnNonReceipt = 3;                            { enclose original in non-delivery reports }
  270.  
  271.  
  272.     type
  273.         MailLetterID = IPMMsgID;
  274.  
  275.         MailTime = record
  276.                 time: UTCTime;                                { current UTC(GMT) time }
  277.                 offset: UTCOffset;                                { offset from GMT }
  278.             end;
  279.  
  280. { innermost letter has nestingLevel 0 }
  281.         MailNestingLevel = INTEGER;
  282.  
  283.         MailRecipient = OCERecipient;
  284.  
  285. {************************************************************************************}
  286.  
  287.     const
  288.         kMailTextSegmentBit = 0;
  289.         kMailPictSegmentBit = 1;
  290.         kMailSoundSegmentBit = 2;
  291.         kMailStyledTextSegmentBit = 3;
  292.         kMailMovieSegmentBit = 4;
  293.  
  294.  
  295.     type
  296.         MailSegmentMask = INTEGER;
  297.  
  298. { Values of MailSegmentMask }
  299.  
  300.     const
  301.         kMailTextSegmentMask = $1;
  302.         kMailPictSegmentMask = $2;
  303.         kMailSoundSegmentMask = $4;
  304.         kMailStyledTextSegmentMask = $8;
  305.         kMailMovieSegmentMask = $10;
  306.  
  307.  
  308.     type
  309.         MailSegmentType = INTEGER;
  310.  
  311. { Values of MailSegmentType }
  312.  
  313.     const
  314.         kMailInvalidSegmentType = 0;
  315.         kMailTextSegmentType = 1;
  316.         kMailPictSegmentType = 2;
  317.         kMailSoundSegmentType = 3;
  318.         kMailStyledTextSegmentType = 4;
  319.         kMailMovieSegmentType = 5;
  320.  
  321. {************************************************************************************}
  322.         kMailErrorLogEntryVersion = $101;
  323.         kMailMSAMErrorStringListID = 128;                            { These 'STR#' resources should be }
  324.         kMailMSAMActionStringListID = 129;                            { in the PMSAM resource fork }
  325.  
  326.  
  327.     type
  328.         MailLogErrorType = INTEGER;
  329.  
  330. { Values of MailLogErrorType }
  331.  
  332.     const
  333.         kMailELECorrectable = 0;
  334.         kMailELEError = 1;
  335.         kMailELEWarning = 2;
  336.         kMailELEInformational = 3;
  337.  
  338.  
  339.     type
  340.         MailLogErrorCode = INTEGER;
  341.  
  342. { Values of MailLogErrorCode }
  343.  
  344.     const
  345.         kMailMSAMErrorCode = 0;                            { positive codes are indices into}
  346. {                                                   PMSAM defined strings }
  347.         kMailMiscError = -1;                            { negative codes are OCE defined }
  348.         kMailNoModem = -2;                            { modem required, but missing }
  349.  
  350.  
  351.     type
  352.         MailErrorLogEntryInfo = record
  353.                 version: INTEGER;
  354.                 timeOccurred: UTCTime;                                { do not fill in }
  355.                 reportingPMSAM: Str31;                                    { do not fill in }
  356.                 reportingMSAMSlot: Str31;                                    { do not fill in }
  357.                 errorType: MailLogErrorType;
  358.                 errorCode: MailLogErrorCode;
  359.                 errorResource: INTEGER;                                { resources are valid if }
  360.                 actionResource: INTEGER;                                { errorCode = kMailMSAMErrorCode}
  361. {                                                   index starts from 1 }
  362.                 filler: LONGINT;
  363.                 filler2: INTEGER;
  364.             end;
  365.  
  366. {************************************************************************************}
  367.         MailBlockMode = INTEGER;
  368.  
  369. { Values of MailBlockMode }
  370.  
  371.     const
  372.         kMailFromStart = 1;                            { write data from offset calculated from }
  373.         kMailFromLEOB = 2;                            { start of block, end of block, }
  374.         kMailFromMark = 3;                            { or from the current mark }
  375.  
  376.  
  377.     type
  378.         MailEnclosureInfo = record
  379.                 enclosureName: StringPtr;
  380.                 catInfo: CInfoPBPtr;
  381.                 comment: StringPtr;
  382.                 icon: Ptr;
  383.             end;
  384.  
  385. {************************************************************************************}
  386.  
  387.     const
  388.         kOCESetupLocationNone = 0;                            { disconnect state }
  389.         kOCESetupLocationMax = 8;                            { maximum location value }
  390.  
  391.  
  392.     type
  393.         OCESetupLocation = CHAR;
  394.  
  395. { location state is a bitmask, 0x1=>1st location active, }
  396. { * 0x2 => 2nd, 0x4 => 3rd, etc.}
  397. { }
  398.         MailLocationFlags = SInt8;
  399.  
  400.         MailLocationInfo = record
  401.                 location: OCESetupLocation;
  402.                 active: MailLocationFlags;
  403.             end;
  404.  
  405. {************************************************************************************}
  406. { Definitions for Personal MSAMs }
  407. {************************************************************************************}
  408.  
  409.     const
  410.         kMailEPPCMsgVersion = 3;
  411.  
  412.  
  413.     type
  414.         MailEPPCMsg = record
  415.                 version: INTEGER;
  416.                 case INTEGER of
  417.                     0: (
  418.                             theSMCA: ^SMCA;                                { for 'crsl', 'mdsl', 'dlsl', 'sndi', 'msgo', 'admn' }
  419.                     );
  420.                     1: (
  421.                             sequenceNumber: LONGINT;                            { for 'inqu', 'dlom' }
  422.                     );
  423.                     2: (
  424.                             locationInfo: MailLocationInfo;                    { for 'locc' }
  425.                     );
  426.             end;
  427.  
  428. { Values of OCE defined High Level Event message classes }
  429.  
  430.     const
  431.         kMailEPPCCreateSlot = 'crsl';
  432.         kMailEPPCModifySlot = 'mdsl';
  433.         kMailEPPCDeleteSlot = 'dlsl';
  434.         kMailEPPCShutDown = 'quit';
  435.         kMailEPPCMailboxOpened = 'mbop';
  436.         kMailEPPCMailboxClosed = 'mbcl';
  437.         kMailEPPCMsgPending = 'msgp';
  438.         kMailEPPCSendImmediate = 'sndi';
  439.         kMailEPPCContinue = 'cont';
  440.         kMailEPPCSchedule = 'sked';
  441.         kMailEPPCAdmin = 'admn';
  442.         kMailEPPCInQUpdate = 'inqu';
  443.         kMailEPPCMsgOpened = 'msgo';
  444.         kMailEPPCDeleteOutQMsg = 'dlom';
  445.         kMailEPPCWakeup = 'wkup';
  446.         kMailEPPCLocationChanged = 'locc';
  447.  
  448.  
  449.     type
  450.         MailTimer = record
  451.                 case INTEGER of
  452.                     0: (
  453.                             frequency: LONGINT;                            { how often to connect }
  454.                     );
  455.                     1: (
  456.                             connectTime: LONGINT;                            { time since midnight }
  457.                     );
  458.             end;
  459.  
  460.  
  461.     const
  462.         kMailTimerOff = 0;                            { control is off }
  463.         kMailTimerTime = 1;                            { specifies connect time (relative to midnight) }
  464.         kMailTimerFrequency = 2;                            { specifies connect frequency }
  465.  
  466.  
  467.     type
  468.         MailTimerKind = SInt8;
  469.  
  470.         MailTimers = record
  471.                 sendTimeKind: MailTimerKind;                            { either kMailTimerTime or kMailTimerFrequency }
  472.                 receiveTimeKind: MailTimerKind;                            { either kMailTimerTime or kMailTimerFrequency }
  473.                 send: MailTimer;
  474.                 receive: MailTimer;
  475.             end;
  476.  
  477.         MailStandardSlotInfoAttribute = record
  478.                 version: INTEGER;
  479.                 active: MailLocationFlags;                        { active if MailLocationMask(i) is set }
  480.                 padByte: SInt8; { Byte }
  481.                 sendReceiveTimer: MailTimers;
  482.             end;
  483.  
  484.         PMSAMGetMSAMRecordPB = record
  485.                 qLink: Ptr;
  486.                 reservedH1: LONGINT;
  487.                 reservedH2: LONGINT;
  488.                 ioCompletion: MSAMIOCompletionUPP;
  489.                 ioResult: OSErr;
  490.                 saveA5: LONGINT;
  491.                 reqCode: INTEGER;
  492.                 msamCID: CreationID;
  493.             end;
  494.  
  495.         PMSAMOpenQueuesPB = record
  496.                 qLink: Ptr;
  497.                 reservedH1: LONGINT;
  498.                 reservedH2: LONGINT;
  499.                 ioCompletion: MSAMIOCompletionUPP;
  500.                 ioResult: OSErr;
  501.                 saveA5: LONGINT;
  502.                 reqCode: INTEGER;
  503.                 inQueueRef: MSAMQueueRef;
  504.                 outQueueRef: MSAMQueueRef;
  505.                 msamSlotID: MSAMSlotID;
  506.                 filler: array[0..1] of LONGINT;
  507.             end;
  508.  
  509.         PMSAMStatus = INTEGER;
  510.  
  511. { Values of PMSAMStatus }
  512.  
  513.     const
  514.         kPMSAMStatusPending = 1;                            { for inQueue and outQueue }
  515.         kPMSAMStatusError = 2;                            { for inQueue and outQueue }
  516.         kPMSAMStatusSending = 3;                            { for outQueue only }
  517.         kPMSAMStatusCaching = 4;                            { for inQueue only }
  518.         kPMSAMStatusSent = 5;                            { for outQueue only }
  519.  
  520.  
  521.     type
  522.         PMSAMSetStatusPB = record
  523.                 qLink: Ptr;
  524.                 reservedH1: LONGINT;
  525.                 reservedH2: LONGINT;
  526.                 ioCompletion: MSAMIOCompletionUPP;
  527.                 ioResult: OSErr;
  528.                 saveA5: LONGINT;
  529.                 reqCode: INTEGER;
  530.                 queueRef: MSAMQueueRef;
  531.                 seqNum: LONGINT;
  532.                 msgHint: LONGINT;                                { for posting cache error,set this to 0 when report outq status }
  533.                 status: PMSAMStatus;
  534.             end;
  535.  
  536.         PMSAMLogErrorPB = record
  537.                 qLink: Ptr;
  538.                 reservedH1: LONGINT;
  539.                 reservedH2: LONGINT;
  540.                 ioCompletion: MSAMIOCompletionUPP;
  541.                 ioResult: OSErr;
  542.                 saveA5: LONGINT;
  543.                 reqCode: INTEGER;
  544.                 msamSlotID: MSAMSlotID;                                { 0 for PMSAM errors }
  545.                 logEntry: ^MailErrorLogEntryInfo;
  546.                 filler: array[0..1] of LONGINT;
  547.             end;
  548.  
  549. {**************************************************************************************}
  550.  
  551.     const
  552.         kMailMsgSummaryVersion = 1;
  553.  
  554.  
  555.     type
  556.         MailMasterData = record
  557.                 attrMask: MailAttributeBitmap;                    { indicates attributes present in MsgSummary }
  558.                 messageID: MailLetterID;
  559.                 replyID: MailLetterID;
  560.                 conversationID: MailLetterID;
  561.             end;
  562.  
  563. { Values for addressedToMe in struct MailCoreData }
  564.  
  565.     const
  566.         kAddressedAs_TO = $1;
  567.         kAddressedAs_CC = $2;
  568.         kAddressedAs_BCC = $4;
  569.  
  570.  
  571.     type
  572.         MailCoreData = record
  573.                 letterFlags: MailLetterFlags;
  574.                 messageSize: LONGINT;
  575.                 letterIndications: MailIndications;
  576.                 messageType: OCECreatorType;
  577.                 sendTime: MailTime;
  578.                 messageFamily: OSType;
  579.                 reserved: SInt8; { unsigned char }
  580.                 addressedToMe: SInt8; { unsigned char }
  581.                 agentInfo: array[0..5] of CHAR;                    { 6 bytes of special info [set to zero]}
  582. {    * these are variable length and even padded }
  583.                 sender: RString32;                                { recipient's entityName (trunc)}
  584.                 subject: RString32;                                { subject maybe truncated }
  585.             end;
  586.  
  587.         MSAMMsgSummary = record
  588.                 version: INTEGER;                                { following flags are defaulted by Toolbox }
  589.                 msgDeleted: BOOLEAN;                                { true if msg is to be deleted by PMSAM }
  590.                 msgUpdated: BOOLEAN;                                { true if msgSummary was updated by MailManager }
  591.                 msgCached: BOOLEAN;                                { true if msg is in the slot's InQueue }
  592.                 padByte: SInt8; { Byte }
  593.                 masterData: MailMasterData;
  594.                 coreData: MailCoreData;
  595.             end;
  596.  
  597. { PMSAM can put up to 128 bytes of private msg summary data }
  598.  
  599.     const
  600.         kMailMaxPMSAMMsgSummaryData = 128;
  601.  
  602.  
  603.     type
  604.         PMSAMCreateMsgSummaryPB = record
  605.                 qLink: Ptr;
  606.                 reservedH1: LONGINT;
  607.                 reservedH2: LONGINT;
  608.                 ioCompletion: MSAMIOCompletionUPP;
  609.                 ioResult: OSErr;
  610.                 saveA5: LONGINT;
  611.                 reqCode: INTEGER;
  612.                 inQueueRef: MSAMQueueRef;
  613.                 seqNum: LONGINT;                                { <- seq of the new message }
  614.                 msgSummary: ^MSAMMsgSummary;                        { attributes and mask filled in }
  615.                 buffer: ^MailBuffer;                            { PMSAM specific data to be appended }
  616.             end;
  617.  
  618.         PMSAMPutMsgSummaryPB = record
  619.                 qLink: Ptr;
  620.                 reservedH1: LONGINT;
  621.                 reservedH2: LONGINT;
  622.                 ioCompletion: MSAMIOCompletionUPP;
  623.                 ioResult: OSErr;
  624.                 saveA5: LONGINT;
  625.                 reqCode: INTEGER;
  626.                 inQueueRef: MSAMQueueRef;
  627.                 seqNum: LONGINT;
  628.                 letterFlags: ^MailMaskedLetterFlags;                    { if not nil, then set msgStoreFlags }
  629.                 buffer: ^MailBuffer;                            { PMSAM specific data to be overwritten }
  630.             end;
  631.  
  632.         PMSAMGetMsgSummaryPB = record
  633.                 qLink: Ptr;
  634.                 reservedH1: LONGINT;
  635.                 reservedH2: LONGINT;
  636.                 ioCompletion: MSAMIOCompletionUPP;
  637.                 ioResult: OSErr;
  638.                 saveA5: LONGINT;
  639.                 reqCode: INTEGER;
  640.                 inQueueRef: MSAMQueueRef;
  641.                 seqNum: LONGINT;
  642.                 msgSummary: ^MSAMMsgSummary;                        { if not nil, then read in the msgSummary }
  643.                 buffer: ^MailBuffer;                            { PMSAM specific data to be read }
  644.                 msgSummaryOffset: INTEGER;                                { offset of PMSAM specific data}
  645. {                                               from start of MsgSummary }
  646.             end;
  647.  
  648. {**************************************************************************************}
  649. { Definitions for Server MSAMs }
  650. {************************************************************************************}
  651.         SMSAMAdminCode = INTEGER;
  652.  
  653. { Values of SMSAMAdminCode }
  654.  
  655.     const
  656.         kSMSAMNotifyFwdrSetupChange = 1;
  657.         kSMSAMNotifyFwdrNameChange = 2;
  658.         kSMSAMNotifyFwdrPwdChange = 3;
  659.         kSMSAMGetDynamicFwdrParams = 4;
  660.  
  661.  
  662.     type
  663.         SMSAMSlotChanges = LONGINT;
  664.  
  665.  
  666.     const
  667.         kSMSAMFwdrHomeInternetChangedBit = 0;
  668.         kSMSAMFwdrConnectedToChangedBit = 1;
  669.         kSMSAMFwdrForeignRLIsChangedBit = 2;
  670.         kSMSAMFwdrMnMServerChangedBit = 3;
  671.  
  672. { Values of SMSAMSlotChanges }
  673.         kSMSAMFwdrEverythingChangedMask = -1;
  674.         kSMSAMFwdrHomeInternetChangedMask = $1;
  675.         kSMSAMFwdrConnectedToChangedMask = $2;
  676.         kSMSAMFwdrForeignRLIsChangedMask = $4;
  677.         kSMSAMFwdrMnMServerChangedMask = $8;
  678.  
  679. { kSMSAMNotifyFwdrSetupChange }
  680.  
  681.     type
  682.         SMSAMSetupChange = record
  683.                 whatChanged: SMSAMSlotChanges;                        {  --> bitmap of what parameters changed }
  684.                 serverHint: AddrBlock;                                {  --> try this ADAP server first }
  685.             end;
  686.  
  687. { kSMSAMNotifyFwdrNameChange }
  688.         SMSAMNameChange = record
  689.                 newName: RString;                                {  --> msams new name }
  690.                 serverHint: AddrBlock;                                {  --> try this ADAP server first }
  691.             end;
  692.  
  693. { kSMSAMNotifyFwdrPasswordChange }
  694.         SMSAMPasswordChange = record
  695.                 newPassword: RString;                                {  --> msams new password }
  696.                 serverHint: AddrBlock;                                {  --> try this ADAP server first }
  697.             end;
  698.  
  699. { kSMSAMGetDynamicFwdrParams }
  700.         SMSAMDynamicParams = record
  701.                 curDiskUsed: LONGINT;                                { <--  amount of disk space used by msam }
  702.                 curMemoryUsed: LONGINT;                                { <--  amount of memory used by msam }
  703.             end;
  704.  
  705.         SMSAMAdminEPPCRequest = record
  706.                 adminCode: SMSAMAdminCode;
  707.                 case INTEGER of
  708.                     0: (
  709.                             setupChange: SMSAMSetupChange;
  710.                     );
  711.                     1: (
  712.                             nameChange: SMSAMNameChange;
  713.                     );
  714.                     2: (
  715.                             passwordChange: SMSAMPasswordChange;
  716.                     );
  717.                     3: (
  718.                             dynamicParams: SMSAMDynamicParams;
  719.                     );
  720.             end;
  721.  
  722.         SMSAMSetupPB = record
  723.                 qLink: Ptr;
  724.                 reservedH1: LONGINT;
  725.                 reservedH2: LONGINT;
  726.                 ioCompletion: MSAMIOCompletionUPP;
  727.                 ioResult: OSErr;
  728.                 saveA5: LONGINT;
  729.                 reqCode: INTEGER;
  730.                 serverMSAM: RecordIDPtr;
  731.                 password: RStringPtr;
  732.                 gatewayType: OSType;
  733.                 gatewayTypeDescription: RStringPtr;
  734.                 catalogServerHint: AddrBlock;
  735.             end;
  736.  
  737.         SMSAMStartupPB = record
  738.                 qLink: Ptr;
  739.                 reservedH1: LONGINT;
  740.                 reservedH2: LONGINT;
  741.                 ioCompletion: MSAMIOCompletionUPP;
  742.                 ioResult: OSErr;
  743.                 saveA5: LONGINT;
  744.                 reqCode: INTEGER;
  745.                 msamIdentity: AuthIdentity;
  746.                 queueRef: MSAMQueueRef;
  747.             end;
  748.  
  749.         SMSAMShutdownPB = record
  750.                 qLink: Ptr;
  751.                 reservedH1: LONGINT;
  752.                 reservedH2: LONGINT;
  753.                 ioCompletion: MSAMIOCompletionUPP;
  754.                 ioResult: OSErr;
  755.                 saveA5: LONGINT;
  756.                 reqCode: INTEGER;
  757.                 queueRef: MSAMQueueRef;
  758.             end;
  759.  
  760. {**************************************************************************************}
  761. { Definitions for reading and writing MSAM Letters }
  762. {**************************************************************************************}
  763.         MSAMEnumeratePB = record
  764.                 qLink: Ptr;
  765.                 reservedH1: LONGINT;
  766.                 reservedH2: LONGINT;
  767.                 ioCompletion: MSAMIOCompletionUPP;
  768.                 ioResult: OSErr;
  769.                 saveA5: LONGINT;
  770.                 reqCode: INTEGER;
  771.                 queueRef: MSAMQueueRef;
  772.                 startSeqNum: LONGINT;
  773.                 nextSeqNum: LONGINT;
  774.         { buffer contains a Mail Reply. Each tuple is a }
  775. {    MSAMEnumerateInQReply when enumerating the inQueue}
  776. {    MSAMEnumerateOutQReply when enumerating the outQueue }
  777.                 buffer: MailBuffer;
  778.             end;
  779.  
  780.         MSAMEnumerateInQReply = record
  781.                 seqNum: LONGINT;
  782.                 msgDeleted: BOOLEAN;                                { true if msg is to be deleted by PMSAM }
  783.                 msgUpdated: BOOLEAN;                                { true if MsgSummary has been updated by TB }
  784.                 msgCached: BOOLEAN;                                { true if msg is in the incoming queue }
  785.                 padByte: SInt8; { Byte }
  786.             end;
  787.  
  788.         MSAMEnumerateOutQReply = record
  789.                 seqNum: LONGINT;
  790.                 done: BOOLEAN;                                { true if all responsible recipients have been processed }
  791.                 priority: IPMPriority;
  792.                 msgFamily: OSType;
  793.                 approxSize: LONGINT;
  794.                 tunnelForm: BOOLEAN;                                { true if this letter has to be tunnelled }
  795.                 padByte: SInt8; { Byte }
  796.                 nextHop: NetworkSpec;                            { valid if tunnelForm is true }
  797.                 msgType: OCECreatorType;
  798.             end;
  799.  
  800.         MSAMDeletePB = record
  801.                 qLink: Ptr;
  802.                 reservedH1: LONGINT;
  803.                 reservedH2: LONGINT;
  804.                 ioCompletion: MSAMIOCompletionUPP;
  805.                 ioResult: OSErr;
  806.                 saveA5: LONGINT;
  807.                 reqCode: INTEGER;
  808.                 queueRef: MSAMQueueRef;
  809.                 seqNum: LONGINT;
  810.                 msgOnly: BOOLEAN;                                { only valid for PMSAM & inQueue }
  811.         { set true to delete message but not msgSummary }
  812.                 padByte: SInt8; { Byte }
  813.         { only valid for SMSAM & tunnelled messages }
  814.                 result: OSErr;
  815.             end;
  816.  
  817.         MSAMOpenPB = record
  818.                 qLink: Ptr;
  819.                 reservedH1: LONGINT;
  820.                 reservedH2: LONGINT;
  821.                 ioCompletion: MSAMIOCompletionUPP;
  822.                 ioResult: OSErr;
  823.                 saveA5: LONGINT;
  824.                 reqCode: INTEGER;
  825.                 queueRef: MSAMQueueRef;
  826.                 seqNum: LONGINT;
  827.                 mailMsgRef: MailMsgRef;
  828.             end;
  829.  
  830.         MSAMOpenNestedPB = record
  831.                 qLink: Ptr;
  832.                 reservedH1: LONGINT;
  833.                 reservedH2: LONGINT;
  834.                 ioCompletion: MSAMIOCompletionUPP;
  835.                 ioResult: OSErr;
  836.                 saveA5: LONGINT;
  837.                 reqCode: INTEGER;
  838.                 mailMsgRef: MailMsgRef;
  839.                 nestedRef: MailMsgRef;
  840.             end;
  841.  
  842.         MSAMClosePB = record
  843.                 qLink: Ptr;
  844.                 reservedH1: LONGINT;
  845.                 reservedH2: LONGINT;
  846.                 ioCompletion: MSAMIOCompletionUPP;
  847.                 ioResult: OSErr;
  848.                 saveA5: LONGINT;
  849.                 reqCode: INTEGER;
  850.                 mailMsgRef: MailMsgRef;
  851.             end;
  852.  
  853.         MSAMGetMsgHeaderPB = record
  854.                 qLink: Ptr;
  855.                 reservedH1: LONGINT;
  856.                 reservedH2: LONGINT;
  857.                 ioCompletion: MSAMIOCompletionUPP;
  858.                 ioResult: OSErr;
  859.                 saveA5: LONGINT;
  860.                 reqCode: INTEGER;
  861.                 mailMsgRef: MailMsgRef;
  862.                 selector: IPMHeaderSelector;
  863.                 filler1: BOOLEAN;
  864.                 offset: LONGINT;
  865.                 buffer: MailBuffer;
  866.                 remaining: LONGINT;
  867.             end;
  868.  
  869.         MSAMGetAttributesPB = record
  870.                 qLink: Ptr;
  871.                 reservedH1: LONGINT;
  872.                 reservedH2: LONGINT;
  873.                 ioCompletion: MSAMIOCompletionUPP;
  874.                 ioResult: OSErr;
  875.                 saveA5: LONGINT;
  876.                 reqCode: INTEGER;
  877.                 mailMsgRef: MailMsgRef;
  878.                 requestMask: MailAttributeBitmap;                    { kMailIndicationsBit thru kMailSubjectBit }
  879.                 buffer: MailBuffer;
  880.         {    buffer returned will contain the attribute values of }
  881. {        the attributes indicated in responseMask, }
  882. {        from the attribute indicated by the least significant bit set}
  883. {        to the attribute indicated by the most significant bit set.}
  884. {        Note that recipients - from, to, cc, bcc cannot be read using}
  885. {        this call. Use GetRecipients to read these. }
  886.                 responseMask: MailAttributeBitmap;
  887.                 more: BOOLEAN;
  888.                 filler1: BOOLEAN;
  889.             end;
  890.  
  891. { attrID value to get resolved recipient list }
  892.  
  893.     const
  894.         kMailResolvedList = 0;
  895.  
  896.  
  897.     type
  898.         MailOriginalRecipient = record
  899.                 index: INTEGER;
  900.             end;
  901.  
  902. { Followed by OCEPackedRecipient }
  903.         MailResolvedRecipient = record
  904.                 index: INTEGER;
  905.                 recipientFlags: INTEGER;
  906.                 responsible: BOOLEAN;
  907.                 padByte: SInt8; { Byte }
  908.             end;
  909.  
  910. { Followed by OCEPackedRecipient }
  911.         MSAMGetRecipientsPB = record
  912.                 qLink: Ptr;
  913.                 reservedH1: LONGINT;
  914.                 reservedH2: LONGINT;
  915.                 ioCompletion: MSAMIOCompletionUPP;
  916.                 ioResult: OSErr;
  917.                 saveA5: LONGINT;
  918.                 reqCode: INTEGER;
  919.                 mailMsgRef: MailMsgRef;
  920.                 attrID: MailAttributeID;                        { kMailFromBit thru kMailBccBit }
  921.                 startIndex: INTEGER;                                { starts at 1 }
  922.                 buffer: MailBuffer;
  923.         {     buffer contains a Mail Reply. Each tuple is a}
  924. {        MailOriginalRecipient if getting original recipients }
  925. {                                ie the attrID is kMail[From, To, Cc, Bcc]Bit}
  926. {        MailResolvedRecipient if getting resolved reicpients}
  927. {                                ie the attrID is kMailResolvedList}
  928. {        Both tuples are word alligned.  }
  929.                 nextIndex: INTEGER;
  930.                 more: BOOLEAN;
  931.                 filler1: BOOLEAN;
  932.             end;
  933.  
  934.         MSAMGetContentPB = record
  935.                 qLink: Ptr;
  936.                 reservedH1: LONGINT;
  937.                 reservedH2: LONGINT;
  938.                 ioCompletion: MSAMIOCompletionUPP;
  939.                 ioResult: OSErr;
  940.                 saveA5: LONGINT;
  941.                 reqCode: INTEGER;
  942.                 mailMsgRef: MailMsgRef;
  943.                 segmentMask: MailSegmentMask;
  944.                 buffer: MailBuffer;
  945.                 textScrap: ^StScrpRec;
  946.                 script: ScriptCode;
  947.                 segmentType: MailSegmentType;
  948.                 endOfScript: BOOLEAN;
  949.                 endOfSegment: BOOLEAN;
  950.                 endOfContent: BOOLEAN;
  951.                 filler1: BOOLEAN;
  952.                 segmentLength: LONGINT;                                { NEW: <-  valid first call in a segment }
  953.                 segmentID: LONGINT;                                { NEW: <-> identifier for this segment }
  954.             end;
  955.  
  956.         MSAMGetEnclosurePB = record
  957.                 qLink: Ptr;
  958.                 reservedH1: LONGINT;
  959.                 reservedH2: LONGINT;
  960.                 ioCompletion: MSAMIOCompletionUPP;
  961.                 ioResult: OSErr;
  962.                 saveA5: LONGINT;
  963.                 reqCode: INTEGER;
  964.                 mailMsgRef: MailMsgRef;
  965.                 contentEnclosure: BOOLEAN;
  966.                 padByte: SInt8; { Byte }
  967.                 buffer: MailBuffer;
  968.                 endOfFile: BOOLEAN;
  969.                 endOfEnclosures: BOOLEAN;
  970.             end;
  971.  
  972.         MailBlockInfo = record
  973.                 blockType: OCECreatorType;
  974.                 offset: LONGINT;
  975.                 blockLength: LONGINT;
  976.             end;
  977.  
  978.         MSAMEnumerateBlocksPB = record
  979.                 qLink: Ptr;
  980.                 reservedH1: LONGINT;
  981.                 reservedH2: LONGINT;
  982.                 ioCompletion: MSAMIOCompletionUPP;
  983.                 ioResult: OSErr;
  984.                 saveA5: LONGINT;
  985.                 reqCode: INTEGER;
  986.                 mailMsgRef: MailMsgRef;
  987.                 startIndex: INTEGER;                                { starts at 1 }
  988.                 buffer: MailBuffer;
  989.         {     buffer contains a Mail Reply. Each tuple is a MailBlockInfo }
  990.                 nextIndex: INTEGER;
  991.                 more: BOOLEAN;
  992.                 filler1: BOOLEAN;
  993.             end;
  994.  
  995.         MSAMGetBlockPB = record
  996.                 qLink: Ptr;
  997.                 reservedH1: LONGINT;
  998.                 reservedH2: LONGINT;
  999.                 ioCompletion: MSAMIOCompletionUPP;
  1000.                 ioResult: OSErr;
  1001.                 saveA5: LONGINT;
  1002.                 reqCode: INTEGER;
  1003.                 mailMsgRef: MailMsgRef;
  1004.                 blockType: OCECreatorType;
  1005.                 blockIndex: INTEGER;
  1006.                 buffer: MailBuffer;
  1007.                 dataOffset: LONGINT;
  1008.                 endOfBlock: BOOLEAN;
  1009.                 padByte: SInt8; { Byte }
  1010.                 remaining: LONGINT;
  1011.             end;
  1012.  
  1013. { YOU SHOULD BE USING THE NEW FORM OF MARK RECIPIENTS}
  1014. { * THIS VERSION IS MUCH SLOWER AND KEPT FOR COMPATIBILITY}
  1015. { * REASONS.}
  1016. {}
  1017. { not valid for tunnel form letters }
  1018.         MSAMMarkRecipientsPB = record
  1019.                 qLink: Ptr;
  1020.                 reservedH1: LONGINT;
  1021.                 reservedH2: LONGINT;
  1022.                 ioCompletion: MSAMIOCompletionUPP;
  1023.                 ioResult: OSErr;
  1024.                 saveA5: LONGINT;
  1025.                 reqCode: INTEGER;
  1026.                 queueRef: MSAMQueueRef;
  1027.                 seqNum: LONGINT;
  1028.         {     buffer contains a Mail Reply. Each tuple is an unsigned short,}
  1029. {        the index of a recipient to be marked. }
  1030.                 buffer: MailBuffer;
  1031.             end;
  1032.  
  1033. { }
  1034. { * same as MSAMMarkRecipients except it takes a mailMsgRef instead of }
  1035. { * queueRef, seqNum }
  1036. {}
  1037. { not valid for tunnel form letters }
  1038.         MSAMnMarkRecipientsPB = record
  1039.                 qLink: Ptr;
  1040.                 reservedH1: LONGINT;
  1041.                 reservedH2: LONGINT;
  1042.                 ioCompletion: MSAMIOCompletionUPP;
  1043.                 ioResult: OSErr;
  1044.                 saveA5: LONGINT;
  1045.                 reqCode: INTEGER;
  1046.                 mailMsgRef: MailMsgRef;
  1047.         {     buffer contains a Mail Reply. Each tuple is an unsigned short,}
  1048. {        the index of a recipient to be marked. }
  1049.                 buffer: MailBuffer;
  1050.             end;
  1051.  
  1052. {**************************************************************************************}
  1053.         MSAMCreatePB = record
  1054.                 qLink: Ptr;
  1055.                 reservedH1: LONGINT;
  1056.                 reservedH2: LONGINT;
  1057.                 ioCompletion: MSAMIOCompletionUPP;
  1058.                 ioResult: OSErr;
  1059.                 saveA5: LONGINT;
  1060.                 reqCode: INTEGER;
  1061.                 queueRef: MSAMQueueRef;
  1062.                 asLetter: BOOLEAN;                                { indicate if we should create as letter or msg }
  1063.                 filler1: BOOLEAN;
  1064.                 msgType: IPMMsgType;                                { up to application discretion: must be of IPMSenderTag}
  1065. {                                           kIPMOSFormatType for asLetter=true }
  1066.                 refCon: LONGINT;                                { for messages only }
  1067.                 seqNum: LONGINT;                                { set if creating message in the inQueue }
  1068.                 tunnelForm: BOOLEAN;                                { if true tunnelForm else newForm }
  1069.                 bccRecipients: BOOLEAN;                                { true if creating letter with bcc recipients }
  1070.                 newRef: MailMsgRef;
  1071.             end;
  1072.  
  1073.         MSAMBeginNestedPB = record
  1074.                 qLink: Ptr;
  1075.                 reservedH1: LONGINT;
  1076.                 reservedH2: LONGINT;
  1077.                 ioCompletion: MSAMIOCompletionUPP;
  1078.                 ioResult: OSErr;
  1079.                 saveA5: LONGINT;
  1080.                 reqCode: INTEGER;
  1081.                 mailMsgRef: MailMsgRef;
  1082.                 refCon: LONGINT;                                { for messages only }
  1083.                 msgType: IPMMsgType;
  1084.             end;
  1085.  
  1086.         MSAMEndNestedPB = record
  1087.                 qLink: Ptr;
  1088.                 reservedH1: LONGINT;
  1089.                 reservedH2: LONGINT;
  1090.                 ioCompletion: MSAMIOCompletionUPP;
  1091.                 ioResult: OSErr;
  1092.                 saveA5: LONGINT;
  1093.                 reqCode: INTEGER;
  1094.                 mailMsgRef: MailMsgRef;
  1095.             end;
  1096.  
  1097.         MSAMSubmitPB = record
  1098.                 qLink: Ptr;
  1099.                 reservedH1: LONGINT;
  1100.                 reservedH2: LONGINT;
  1101.                 ioCompletion: MSAMIOCompletionUPP;
  1102.                 ioResult: OSErr;
  1103.                 saveA5: LONGINT;
  1104.                 reqCode: INTEGER;
  1105.                 mailMsgRef: MailMsgRef;
  1106.                 submitFlag: BOOLEAN;
  1107.                 padByte: SInt8; { Byte }
  1108.                 msgID: MailLetterID;
  1109.             end;
  1110.  
  1111.         MSAMPutMsgHeaderPB = record
  1112.                 qLink: Ptr;
  1113.                 reservedH1: LONGINT;
  1114.                 reservedH2: LONGINT;
  1115.                 ioCompletion: MSAMIOCompletionUPP;
  1116.                 ioResult: OSErr;
  1117.                 saveA5: LONGINT;
  1118.                 reqCode: INTEGER;
  1119.                 mailMsgRef: MailMsgRef;
  1120.                 replyQueue: ^OCERecipient;
  1121.                 sender: ^IPMSender;
  1122.                 deliveryNotification: IPMNotificationType;
  1123.                 priority: IPMPriority;
  1124.             end;
  1125.  
  1126.         MSAMPutAttributePB = record
  1127.                 qLink: Ptr;
  1128.                 reservedH1: LONGINT;
  1129.                 reservedH2: LONGINT;
  1130.                 ioCompletion: MSAMIOCompletionUPP;
  1131.                 ioResult: OSErr;
  1132.                 saveA5: LONGINT;
  1133.                 reqCode: INTEGER;
  1134.                 mailMsgRef: MailMsgRef;
  1135.                 attrID: MailAttributeID;                        { kMailIndicationsBit thru kMailSubjectBit }
  1136.                 buffer: MailBuffer;
  1137.             end;
  1138.  
  1139.         MSAMPutRecipientPB = record
  1140.                 qLink: Ptr;
  1141.                 reservedH1: LONGINT;
  1142.                 reservedH2: LONGINT;
  1143.                 ioCompletion: MSAMIOCompletionUPP;
  1144.                 ioResult: OSErr;
  1145.                 saveA5: LONGINT;
  1146.                 reqCode: INTEGER;
  1147.                 mailMsgRef: MailMsgRef;
  1148.                 attrID: MailAttributeID;                        { kMailFromBit thru kMailBccBit }
  1149.                 recipient: ^MailRecipient;
  1150.                 responsible: BOOLEAN;                                { valid for server and message msams only }
  1151.                 filler1: BOOLEAN;
  1152.             end;
  1153.  
  1154.         MSAMPutContentPB = record
  1155.                 qLink: Ptr;
  1156.                 reservedH1: LONGINT;
  1157.                 reservedH2: LONGINT;
  1158.                 ioCompletion: MSAMIOCompletionUPP;
  1159.                 ioResult: OSErr;
  1160.                 saveA5: LONGINT;
  1161.                 reqCode: INTEGER;
  1162.                 mailMsgRef: MailMsgRef;
  1163.                 segmentType: MailSegmentType;
  1164.                 append: BOOLEAN;
  1165.                 padByte: SInt8; { Byte }
  1166.                 buffer: MailBuffer;
  1167.                 textScrap: ^StScrpRec;
  1168.                 startNewScript: BOOLEAN;
  1169.                 filler1: BOOLEAN;
  1170.                 script: ScriptCode;                                { valid only if startNewScript is true }
  1171.             end;
  1172.  
  1173.         MSAMPutEnclosurePB = record
  1174.                 qLink: Ptr;
  1175.                 reservedH1: LONGINT;
  1176.                 reservedH2: LONGINT;
  1177.                 ioCompletion: MSAMIOCompletionUPP;
  1178.                 ioResult: OSErr;
  1179.                 saveA5: LONGINT;
  1180.                 reqCode: INTEGER;
  1181.                 mailMsgRef: MailMsgRef;
  1182.                 contentEnclosure: BOOLEAN;
  1183.                 padByte: SInt8; { Byte }
  1184.                 hfs: BOOLEAN;                                { true => in file system, false => in memory }
  1185.                 append: BOOLEAN;
  1186.                 buffer: MailBuffer;                                { Unused if hfs == true }
  1187.                 enclosure: FSSpec;
  1188.                 addlInfo: MailEnclosureInfo;
  1189.             end;
  1190.  
  1191.         MSAMPutBlockPB = record
  1192.                 qLink: Ptr;
  1193.                 reservedH1: LONGINT;
  1194.                 reservedH2: LONGINT;
  1195.                 ioCompletion: MSAMIOCompletionUPP;
  1196.                 ioResult: OSErr;
  1197.                 saveA5: LONGINT;
  1198.                 reqCode: INTEGER;
  1199.                 mailMsgRef: MailMsgRef;
  1200.                 refCon: LONGINT;                                { for messages only }
  1201.                 blockType: OCECreatorType;
  1202.                 append: BOOLEAN;
  1203.                 filler1: BOOLEAN;
  1204.                 buffer: MailBuffer;
  1205.                 mode: MailBlockMode;                            { if blockType is kMailTunnelLtrType or kMailHopInfoType}
  1206. {                                       mode is assumed to be kMailFromMark }
  1207.                 offset: LONGINT;
  1208.             end;
  1209.  
  1210. {**************************************************************************************}
  1211.         MSAMCreateReportPB = record
  1212.                 qLink: Ptr;
  1213.                 reservedH1: LONGINT;
  1214.                 reservedH2: LONGINT;
  1215.                 ioCompletion: MSAMIOCompletionUPP;
  1216.                 ioResult: OSErr;
  1217.                 saveA5: LONGINT;
  1218.                 reqCode: INTEGER;
  1219.                 queueRef: MSAMQueueRef;                            { to distinguish personal and server MSAMs }
  1220.                 mailMsgRef: MailMsgRef;
  1221.                 msgID: MailLetterID;                            { kMailLetterIDBit of letter being reported upon }
  1222.                 sender: ^MailRecipient;                            { sender of the letter you are creating report on }
  1223.             end;
  1224.  
  1225.         MSAMPutRecipientReportPB = record
  1226.                 qLink: Ptr;
  1227.                 reservedH1: LONGINT;
  1228.                 reservedH2: LONGINT;
  1229.                 ioCompletion: MSAMIOCompletionUPP;
  1230.                 ioResult: OSErr;
  1231.                 saveA5: LONGINT;
  1232.                 reqCode: INTEGER;
  1233.                 mailMsgRef: MailMsgRef;
  1234.                 recipientIndex: INTEGER;                                { recipient index in the original letter }
  1235.                 result: OSErr;                                    { result of sending the recipient }
  1236.             end;
  1237.  
  1238. {**************************************************************************************}
  1239.         MailWakeupPMSAMPB = record
  1240.                 qLink: Ptr;
  1241.                 reservedH1: LONGINT;
  1242.                 reservedH2: LONGINT;
  1243.                 ioCompletion: MSAMIOCompletionUPP;
  1244.                 ioResult: OSErr;
  1245.                 saveA5: LONGINT;
  1246.                 reqCode: INTEGER;
  1247.                 pmsamCID: CreationID;
  1248.                 mailSlotID: MailSlotID;
  1249.             end;
  1250.  
  1251.         MailCreateMailSlotPB = record
  1252.                 qLink: Ptr;
  1253.                 reservedH1: LONGINT;
  1254.                 reservedH2: LONGINT;
  1255.                 ioCompletion: MSAMIOCompletionUPP;
  1256.                 ioResult: OSErr;
  1257.                 saveA5: LONGINT;
  1258.                 reqCode: INTEGER;
  1259.                 mailboxRef: MailboxRef;
  1260.                 timeout: LONGINT;
  1261.                 pmsamCID: CreationID;
  1262.                 smca: SMCA;
  1263.             end;
  1264.  
  1265.         MailModifyMailSlotPB = record
  1266.                 qLink: Ptr;
  1267.                 reservedH1: LONGINT;
  1268.                 reservedH2: LONGINT;
  1269.                 ioCompletion: MSAMIOCompletionUPP;
  1270.                 ioResult: OSErr;
  1271.                 saveA5: LONGINT;
  1272.                 reqCode: INTEGER;
  1273.                 mailboxRef: MailboxRef;
  1274.                 timeout: LONGINT;
  1275.                 pmsamCID: CreationID;
  1276.                 smca: SMCA;
  1277.             end;
  1278.  
  1279. {**************************************************************************************}
  1280.         MSAMParam = record
  1281.                 case INTEGER of
  1282.                     0: (
  1283.                             qLink: Ptr;
  1284.                             reservedH1: LONGINT;
  1285.                             reservedH2: LONGINT;
  1286.                             ioCompletion: MSAMIOCompletionUPP;
  1287.                             ioResult: OSErr;
  1288.                             saveA5: LONGINT;
  1289.                             reqCode: INTEGER;
  1290.                     );
  1291.                     1: (
  1292.                             pmsamGetMSAMRecord: PMSAMGetMSAMRecordPB;
  1293.                     );
  1294.                     2: (
  1295.                             pmsamOpenQueues: PMSAMOpenQueuesPB;
  1296.                     );
  1297.                     3: (
  1298.                             pmsamSetStatus: PMSAMSetStatusPB;
  1299.                     );
  1300.                     4: (
  1301.                             pmsamLogError: PMSAMLogErrorPB;
  1302.                     );
  1303.                     5: (
  1304.                             smsamSetup: SMSAMSetupPB;
  1305.                     );
  1306.                     6: (
  1307.                             smsamStartup: SMSAMStartupPB;
  1308.                     );
  1309.                     7: (
  1310.                             smsamShutdown: SMSAMShutdownPB;
  1311.                     );
  1312.                     8: (
  1313.                             msamEnumerate: MSAMEnumeratePB;
  1314.                     );
  1315.                     9: (
  1316.                             msamDelete: MSAMDeletePB;
  1317.                     );
  1318.                     10: (
  1319.                             msamOpen: MSAMOpenPB;
  1320.                     );
  1321.                     11: (
  1322.                             msamOpenNested: MSAMOpenNestedPB;
  1323.                     );
  1324.                     12: (
  1325.                             msamClose: MSAMClosePB;
  1326.                     );
  1327.                     13: (
  1328.                             msamGetMsgHeader: MSAMGetMsgHeaderPB;
  1329.                     );
  1330.                     14: (
  1331.                             msamGetAttributes: MSAMGetAttributesPB;
  1332.                     );
  1333.                     15: (
  1334.                             msamGetRecipients: MSAMGetRecipientsPB;
  1335.                     );
  1336.                     16: (
  1337.                             msamGetContent: MSAMGetContentPB;
  1338.                     );
  1339.                     17: (
  1340.                             msamGetEnclosure: MSAMGetEnclosurePB;
  1341.                     );
  1342.                     18: (
  1343.                             msamEnumerateBlocks: MSAMEnumerateBlocksPB;
  1344.                     );
  1345.                     19: (
  1346.                             msamGetBlock: MSAMGetBlockPB;
  1347.                     );
  1348.                     20: (
  1349.                             msamMarkRecipients: MSAMMarkRecipientsPB;
  1350.                     );
  1351.                     21: (
  1352.                             msamnMarkRecipients: MSAMnMarkRecipientsPB;
  1353.                     );
  1354.                     22: (
  1355.                             msamCreate: MSAMCreatePB;
  1356.                     );
  1357.                     23: (
  1358.                             msamBeginNested: MSAMBeginNestedPB;
  1359.                     );
  1360.                     24: (
  1361.                             msamEndNested: MSAMEndNestedPB;
  1362.                     );
  1363.                     25: (
  1364.                             msamSubmit: MSAMSubmitPB;
  1365.                     );
  1366.                     26: (
  1367.                             msamPutMsgHeader: MSAMPutMsgHeaderPB;
  1368.                     );
  1369.                     27: (
  1370.                             msamPutAttribute: MSAMPutAttributePB;
  1371.                     );
  1372.                     28: (
  1373.                             msamPutRecipient: MSAMPutRecipientPB;
  1374.                     );
  1375.                     29: (
  1376.                             msamPutContent: MSAMPutContentPB;
  1377.                     );
  1378.                     30: (
  1379.                             msamPutEnclosure: MSAMPutEnclosurePB;
  1380.                     );
  1381.                     31: (
  1382.                             msamPutBlock: MSAMPutBlockPB;
  1383.                     );
  1384.                     32: (
  1385.                             msamCreateReport: MSAMCreateReportPB;                    { Reports and Error Handling Calls }
  1386.                     );
  1387.                     33: (
  1388.                             msamPutRecipientReport: MSAMPutRecipientReportPB;
  1389.                     );
  1390.                     34: (
  1391.                             pmsamCreateMsgSummary: PMSAMCreateMsgSummaryPB;
  1392.                     );
  1393.                     35: (
  1394.                             pmsamPutMsgSummary: PMSAMPutMsgSummaryPB;
  1395.                     );
  1396.                     36: (
  1397.                             pmsamGetMsgSummary: PMSAMGetMsgSummaryPB;
  1398.                     );
  1399.                     37: (
  1400.                             wakeupPMSAM: MailWakeupPMSAMPB;
  1401.                     );
  1402.                     38: (
  1403.                             createMailSlot: MailCreateMailSlotPB;
  1404.                     );
  1405.                     39: (
  1406.                             modifyMailSlot: MailModifyMailSlotPB;
  1407.                     );
  1408.             end;
  1409.  
  1410.     const
  1411.         uppMSAMIOCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  1412.  
  1413.     procedure CallMSAMIOCompletionProc (var paramBlock: MSAMParam; userRoutine: MSAMIOCompletionUPP);
  1414.     {$IFC NOT GENERATINGCFM}
  1415.     inline
  1416.         $205F, $4E90;
  1417.     {$ENDC}
  1418.  
  1419.     function NewMSAMIOCompletionProc (userRoutine: MSAMIOCompletionProcPtr): MSAMIOCompletionUPP;
  1420.     {$IFC NOT GENERATINGCFM }
  1421.     inline
  1422.         $2E9F;
  1423.     {$ENDC}
  1424.  
  1425.     function MailCreateMailSlot (var paramBlock: MSAMParam): OSErr;
  1426.     {$IFC NOT GENERATINGCFM}
  1427.     inline
  1428.         $7001, $1f00, $3f3c, 1323, $AA5E;
  1429.     {$ENDC}
  1430. { ASYNCHRONOUS ONLY, client must call WaitNextEvent }
  1431.     function MailModifyMailSlot (var paramBlock: MSAMParam): OSErr;
  1432.     {$IFC NOT GENERATINGCFM}
  1433.     inline
  1434.         $7001, $1f00, $3f3c, 1324, $AA5E;
  1435.     {$ENDC}
  1436. { ASYNCHRONOUS ONLY, client must call WaitNextEvent }
  1437.     function MailWakeupPMSAM (var paramBlock: MSAMParam): OSErr;
  1438.     {$IFC NOT GENERATINGCFM}
  1439.     inline
  1440.         $7001, $1f00, $3f3c, 1287, $AA5E;
  1441.     {$ENDC}
  1442. { Personal MSAM Glue Routines }
  1443.     function PMSAMOpenQueues (var paramBlock: MSAMParam): OSErr;
  1444.     {$IFC NOT GENERATINGCFM}
  1445.     inline
  1446.         $7000, $1f00, $3f3c, 1280, $AA5E;
  1447.     {$ENDC}
  1448.     function PMSAMSetStatus (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1449.     {$IFC NOT GENERATINGCFM}
  1450.     inline
  1451.         $3f3c, 1319, $AA5E;
  1452.     {$ENDC}
  1453. { SYNC ONLY }
  1454.     function PMSAMGetMSAMRecord (var paramBlock: MSAMParam): OSErr;
  1455.     {$IFC NOT GENERATINGCFM}
  1456.     inline
  1457.         $7000, $1f00, $3f3c, 1286, $AA5E;
  1458.     {$ENDC}
  1459. { Server MSAM Glue Routines }
  1460. { SYNC ONLY }
  1461.     function SMSAMSetup (var paramBlock: MSAMParam): OSErr;
  1462.     {$IFC NOT GENERATINGCFM}
  1463.     inline
  1464.         $7000, $1f00, $3f3c, 1315, $AA5E;
  1465.     {$ENDC}
  1466. { SYNC ONLY }
  1467.     function SMSAMStartup (var paramBlock: MSAMParam): OSErr;
  1468.     {$IFC NOT GENERATINGCFM}
  1469.     inline
  1470.         $7000, $1f00, $3f3c, 1281, $AA5E;
  1471.     {$ENDC}
  1472.     function SMSAMShutdown (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1473.     {$IFC NOT GENERATINGCFM}
  1474.     inline
  1475.         $3f3c, 1282, $AA5E;
  1476.     {$ENDC}
  1477. { Get Interface Glue Routines }
  1478.     function MSAMEnumerate (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1479.     {$IFC NOT GENERATINGCFM}
  1480.     inline
  1481.         $3f3c, 1283, $AA5E;
  1482.     {$ENDC}
  1483.     function MSAMDelete (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1484.     {$IFC NOT GENERATINGCFM}
  1485.     inline
  1486.         $3f3c, 1284, $AA5E;
  1487.     {$ENDC}
  1488.     function MSAMMarkRecipients (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1489.     {$IFC NOT GENERATINGCFM}
  1490.     inline
  1491.         $3f3c, 1285, $AA5E;
  1492.     {$ENDC}
  1493.     function MSAMnMarkRecipients (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1494.     {$IFC NOT GENERATINGCFM}
  1495.     inline
  1496.         $3f3c, 1298, $AA5E;
  1497.     {$ENDC}
  1498.     function MSAMOpen (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1499.     {$IFC NOT GENERATINGCFM}
  1500.     inline
  1501.         $3f3c, 1288, $AA5E;
  1502.     {$ENDC}
  1503.     function MSAMOpenNested (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1504.     {$IFC NOT GENERATINGCFM}
  1505.     inline
  1506.         $3f3c, 1289, $AA5E;
  1507.     {$ENDC}
  1508.     function MSAMClose (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1509.     {$IFC NOT GENERATINGCFM}
  1510.     inline
  1511.         $3f3c, 1290, $AA5E;
  1512.     {$ENDC}
  1513.     function MSAMGetRecipients (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1514.     {$IFC NOT GENERATINGCFM}
  1515.     inline
  1516.         $3f3c, 1292, $AA5E;
  1517.     {$ENDC}
  1518.     function MSAMGetAttributes (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1519.     {$IFC NOT GENERATINGCFM}
  1520.     inline
  1521.         $3f3c, 1291, $AA5E;
  1522.     {$ENDC}
  1523.     function MSAMGetContent (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1524.     {$IFC NOT GENERATINGCFM}
  1525.     inline
  1526.         $3f3c, 1293, $AA5E;
  1527.     {$ENDC}
  1528.     function MSAMGetEnclosure (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1529.     {$IFC NOT GENERATINGCFM}
  1530.     inline
  1531.         $3f3c, 1294, $AA5E;
  1532.     {$ENDC}
  1533.     function MSAMEnumerateBlocks (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1534.     {$IFC NOT GENERATINGCFM}
  1535.     inline
  1536.         $3f3c, 1295, $AA5E;
  1537.     {$ENDC}
  1538.     function MSAMGetBlock (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1539.     {$IFC NOT GENERATINGCFM}
  1540.     inline
  1541.         $3f3c, 1296, $AA5E;
  1542.     {$ENDC}
  1543.     function MSAMGetMsgHeader (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1544.     {$IFC NOT GENERATINGCFM}
  1545.     inline
  1546.         $3f3c, 1297, $AA5E;
  1547.     {$ENDC}
  1548. { Put Interface Glue Routines }
  1549.     function MSAMCreate (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1550.     {$IFC NOT GENERATINGCFM}
  1551.     inline
  1552.         $3f3c, 1300, $AA5E;
  1553.     {$ENDC}
  1554.     function MSAMBeginNested (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1555.     {$IFC NOT GENERATINGCFM}
  1556.     inline
  1557.         $3f3c, 1301, $AA5E;
  1558.     {$ENDC}
  1559.     function MSAMEndNested (var paramBlock: MSAMParam): OSErr;
  1560.     {$IFC NOT GENERATINGCFM}
  1561.     inline
  1562.         $7000, $1f00, $3f3c, 1302, $AA5E;
  1563.     {$ENDC}
  1564. {  SYNCHRONOUS ONLY }
  1565.     function MSAMSubmit (var paramBlock: MSAMParam): OSErr;
  1566.     {$IFC NOT GENERATINGCFM}
  1567.     inline
  1568.         $7000, $1f00, $3f3c, 1303, $AA5E;
  1569.     {$ENDC}
  1570.     function MSAMPutAttribute (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1571.     {$IFC NOT GENERATINGCFM}
  1572.     inline
  1573.         $3f3c, 1304, $AA5E;
  1574.     {$ENDC}
  1575.     function MSAMPutRecipient (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1576.     {$IFC NOT GENERATINGCFM}
  1577.     inline
  1578.         $3f3c, 1305, $AA5E;
  1579.     {$ENDC}
  1580.     function MSAMPutContent (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1581.     {$IFC NOT GENERATINGCFM}
  1582.     inline
  1583.         $3f3c, 1306, $AA5E;
  1584.     {$ENDC}
  1585. {  SYNCHRONOUS ONLY }
  1586.     function MSAMPutEnclosure (var paramBlock: MSAMParam): OSErr;
  1587.     {$IFC NOT GENERATINGCFM}
  1588.     inline
  1589.         $7000, $1f00, $3f3c, 1307, $AA5E;
  1590.     {$ENDC}
  1591.     function MSAMPutBlock (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1592.     {$IFC NOT GENERATINGCFM}
  1593.     inline
  1594.         $3f3c, 1308, $AA5E;
  1595.     {$ENDC}
  1596.     function MSAMPutMsgHeader (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1597.     {$IFC NOT GENERATINGCFM}
  1598.     inline
  1599.         $3f3c, 1309, $AA5E;
  1600.     {$ENDC}
  1601. { Reports and Error Handling Glue Routines }
  1602.     function MSAMCreateReport (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1603.     {$IFC NOT GENERATINGCFM}
  1604.     inline
  1605.         $3f3c, 1311, $AA5E;
  1606.     {$ENDC}
  1607.     function MSAMPutRecipientReport (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1608.     {$IFC NOT GENERATINGCFM}
  1609.     inline
  1610.         $3f3c, 1312, $AA5E;
  1611.     {$ENDC}
  1612.     function PMSAMLogError (var paramBlock: MSAMParam): OSErr;
  1613.     {$IFC NOT GENERATINGCFM}
  1614.     inline
  1615.         $7000, $1f00, $3f3c, 1313, $AA5E;
  1616.     {$ENDC}
  1617. { MsgSummary Glue Routines }
  1618.     function PMSAMCreateMsgSummary (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1619.     {$IFC NOT GENERATINGCFM}
  1620.     inline
  1621.         $3f3c, 1314, $AA5E;
  1622.     {$ENDC}
  1623.     function PMSAMPutMsgSummary (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1624.     {$IFC NOT GENERATINGCFM}
  1625.     inline
  1626.         $3f3c, 1317, $AA5E;
  1627.     {$ENDC}
  1628.     function PMSAMGetMsgSummary (var paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1629.     {$IFC NOT GENERATINGCFM}
  1630.     inline
  1631.         $3f3c, 1318, $AA5E;
  1632.     {$ENDC}
  1633.  
  1634. { $ALIGN RESET}
  1635. { $POP}
  1636.  
  1637. {$ENDC}
  1638.  {__OCEMAIL__}
  1639.  
  1640. implementation
  1641. end.
  1642.